Tip: You can make an XFS filesystem on a disk partition or a logical volume using the graphical user interface of the xfsm command. For information, see its online help.
Caution: When you create a filesystem, all files already on the disk partition or logical volume are destroyed.
# umount partition
Any data that is on the disk partition is destroyed (to convert the data rather than destroy it, use the procedure in the section "Converting a Filesystem on an Option Disk From EFS to XFS" in this chapter instead).
# mkfs -b size=blocksize -l size=logsize partition
blocksize is the filesystem block size (see the section "Choosing the Filesystem Block Size and Extent Size" in this chapter) and logsize is the size of the area dedicated to log records (see the section "Choosing the Log Type and Size" in this chapter). The default values are 4 KB blocks and a 1000 block log.
Example 4-1 shows the command line used to create an XFS filesystem and the system output. The filesystem has a 10 MB internal log and a block size of 1K bytes and is on the partition /dev/dsk/dks0d2s7.
Example 4-1 : mkfs Command for an XFS Filesystem With an Internal Log
# mkfs -b size=1k -l size=10m /dev/dsk/dks0d2s7 meta-data=/dev/dsk/dks0d2s7 isize=256 agcount=8, agsize=128615 blks data = bsize=1024 blocks=1028916 log =internal log bsize=1024 blocks=10240 realtime =none bsize=65536 blocks=0, rtextents=0
# mkfs -b size=blocksize volume
blocksize is the block size for filesystem (see the section "Choosing the Filesystem Block Size and Extent Size" in this chapter), and volume is the device name for the volume.
Example 4-2 shows the command line used to create an XFS filesystem on a logical volume /dev/dsk/xlv/a with a block size of 1K bytes and the system output.
Example 4-2 : mkfs Command for an XFS Filesystem With an External Log
# mkfs -b size=1k /dev/dsk/xlv/a meta-data=/dev/dsk/xlv/a isize=256 agcount=8, agsize=245530 blks data = bsize=1024 blocks=1964240 log =volume log bsize=1024 blocks=25326 realtime =none bsize=65536 blocks=0, rtextents=0
Example 4-3 shows the command line used to create an XFS filesystem on a logical volume /dev/dsk/xlv/xlv_data1 that includes a log, data, and real-time subvolumes and the system output. The default block size of 4096 bytes is used and the real-time extent size is set to 128K bytes.
Example 4-3 : mkfs Command for an XFS Filesystem With a Real-Time Subvolume
# mkfs_xfs -r extsize=128k /dev/rdsk/xlv/xlv_data1 meta-data=/dev/rdsk/xlv/xlv_data1 isize=256 agcount=8, agsize=4300 blks data = bsize=4096 blocks=34400 log =volume log bsize=4096 blocks=34400 realtime =volume rt bsize=131072 blocks=2560, rtextents=80
# mkdir mountdir
# mount partition mountdir
For more information about mounting filesystems, see the section "Manually Mounting Filesystems" in Chapter 5.
partition mountdir xfs rw,raw=rawpartition 0 0
where rawpartition is the raw version of partition. For example, if partition is /dev/dsk/dks0d2s7, rawpartition is /dev/rdsk/dks0d2s7.
For more information about automatically mounting filesystems, see the section "Mounting Filesystems Automatically With the /etc/fstab File" in Chapter 5.